<template>
   <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page.sync="Page"
      :page-sizes="[10, 20, 30, 40]"
      :page-size.sync="Size"
      layout="total, sizes, prev, pager, next, jumper"
      :total="total">
    </el-pagination>
</template>

<script>
export default {
  props: {
    // pages: {
    //   type: [Number, String],
    //   required: true
    // },
    page: {
      type: Number,
      required: true
    },
    total: {
      type: Number,
      required: true
    },
    size: {
      type: Number,
      required: true
    },
    pager: {
      type: [Number, String],
      required: true
    }
  },
  data () {
    return {
    }
  },
  computed: {
    Page: {
      get () {
        return this.page
      },
      set (val) {
        this.$emit('update:page', val)
      }
    },
    Size: {
      get () {
        return this.size
      },
      set (val) {
        this.$emit('update:size', val)
      }
    }
  },
  created () {},
  mounted () {},
  methods: {
    handleSizeChange () {
      this.$emit('update:page', this.page)
      this.$emit('genxin')
    },
    handleCurrentChange () {
      this.$emit('update:page', this.page)
      this.$emit('genxin')
    }
  }
}
</script>
<style lang="scss" scoped>
</style>
